// 节流
function throttle(fn, delay = 2000){
    let valid = true
    return function(){
        if(valid){
            valid = false
            fn.apply(this, arguments)
            setTimeout(() => {
                valid = true
            }, delay)
        }
    }
}

module.exports = {
	throttle
}